home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ddj0897.zip
/
DYN401.ZIP
/
class
/
intdict.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-04-16
|
4KB
|
142 lines
/* Copyright (c) 1993-1996 Algorithms Corporation */
/* All rights reserved. */
/* This file automatically generated by dpp - do not edit */
#define DPP_STRATEGY 2
#define DPP_FASTWIDE 0
#define CLASS IntegerDictionary_c
#define ivType IntegerDictionary_iv_t
#include "generics.h"
object IntegerDictionary_c;
#line 22 "intdict.d"
#include "set1.h"
#define LTYPE 4
static gLookup_t Lookup;
imeth objrtn IntegerDictionary_im_gAddInt(object self, int key, object value)
{
ChkArgNul(value, 3);
return Lookup(self, (object) &key, HT_ADD, 0, LTYPE, value);
}
imeth objrtn IntegerDictionary_im_gFindValueInt(object self, int key)
{
object x;
x = Lookup(self, (object) &key, HT_FIND, 0, LTYPE, NULL);
return x ? gValue(x) : x;
}
imeth objrtn IntegerDictionary_im_gFindInt(object self, int key)
{
return Lookup(self, (object) &key, HT_FIND, 0, LTYPE, NULL);
}
imeth objrtn IntegerDictionary_im_gChangeValueWithInt(object self, int key, object val)
{
object x;
ChkArgNul(val, 3);
x = Lookup(self, (object) &key, HT_FIND, 0, LTYPE, NULL);
return x ? gChangeValue(x, val) : x;
}
imeth objrtn IntegerDictionary_im_gFindAddInt(object self, int key, object value)
{
ChkArgNul(value, 3);
return Lookup(self, (object) &key, HT_FINDADD, 0, LTYPE, value);
}
imeth objrtn IntegerDictionary_im_gDispose(object self)
{
return gDispose1(self);
}
imeth objrtn IntegerDictionary_im_gDisposeAllNodes(object self)
{
return gDisposeAllNodes1(self);
}
imeth objrtn IntegerDictionary_im_gRemoveInt(object self, int key)
{
return Lookup(self, (object) &key, HT_DELETE, 1, LTYPE, NULL);
}
imeth objrtn IntegerDictionary_im_gDeepDisposeInt(object self, int key)
{
return Lookup(self, (object) &key, HT_DELETE, 2, LTYPE, NULL);
}
static void init_class(void)
{
Lookup = imcPointer(Set, gLookup);
}
#line 93 "intdict.c"
objrtn IntegerDictionary_initialize(void)
{
static CRITICALSECTION cs;
static int volatile once = 0;
ENTERCRITICALSECTION(_CI_CS_);
if (!once) {
INITIALIZECRITICALSECTION(cs);
once = 1;
}
LEAVECRITICALSECTION(_CI_CS_);
ENTERCRITICALSECTION(cs);
if (IntegerDictionary_c) {
LEAVECRITICALSECTION(cs);
return IntegerDictionary_c;
}
INHIBIT_THREADER;
Set_initialize();
if (IntegerDictionary_c) {
ENABLE_THREADER;
LEAVECRITICALSECTION(cs);
return IntegerDictionary_c;
}
IntegerDictionary_c = gNewClass(Class, "IntegerDictionary", 0, 0, Set, END);
iMethodFor(IntegerDictionary, gChangeValueWithInt, IntegerDictionary_im_gChangeValueWithInt);
iMethodFor(IntegerDictionary, gDeepDisposeInt, IntegerDictionary_im_gDeepDisposeInt);
iMethodFor(IntegerDictionary, gDisposeInt, IntegerDictionary_im_gDeepDisposeInt);
iMethodFor(IntegerDictionary, gDisposeAllNodes, IntegerDictionary_im_gDisposeAllNodes);
iMethodFor(IntegerDictionary, gRemoveInt, IntegerDictionary_im_gRemoveInt);
iMethodFor(IntegerDictionary, gFindInt, IntegerDictionary_im_gFindInt);
iMethodFor(IntegerDictionary, gFindValueInt, IntegerDictionary_im_gFindValueInt);
iMethodFor(IntegerDictionary, gDispose, IntegerDictionary_im_gDispose);
iMethodFor(IntegerDictionary, gAddInt, IntegerDictionary_im_gAddInt);
iMethodFor(IntegerDictionary, gFindAddInt, IntegerDictionary_im_gFindAddInt);
init_class();
ENABLE_THREADER;
LEAVECRITICALSECTION(cs);
return IntegerDictionary_c;
}